const Controller = require("./base");
class SystemController extends Controller {
  async user() {
    const ctx = this.ctx;
    const userId = ctx.params.id;
    const user = await ctx.service.user.find(userId);
    this.success(user);
  }
  async search() {

    console.log(1);

    const { ctx } = this; 
    const { username, id, page, pageSize } = ctx.query;
    var where = {username} 

    console.log(where);
    const result = await ctx.service.generic.findAll(
      "user",
      where,
      page,
      pageSize
    );
    ctx.body = result;
  }
}

module.exports = SystemController;
